#ifndef Instance_H
#define Instance_H

#include "framework.h"
#include "textures.h"
#include "utils.h"
#include <map>
#include <string>
#include "shader.h"
#include "coreController.h"

class Instance{
public:
	unsigned long id_instance;
	std::string id_mesh;
	std::string id_controller;
	std::vector<char*> textures;
	Vector3 position;
	Vector3 velocidad;
	int target;
	Shader * shader;
	CoreController * controller;
	Vector3 rebote;
	double timerRebote;
	Instance();
	~Instance();
	Instance(std::string _id_mesh, std::string _id_controller, Vector3 _position, Matrix44 * _model);
	Instance(std::string _id_mesh, std::string _id_controller, Vector3 _position, Matrix44 * _model, std::string _shader);
	void setShader(std::string _shader);
	double speed;
	std::vector<double> timeActions;
	bool isPlayer;
	Matrix44 * model;
};
class Ship : public Instance
{
public:
	
	double life;
	double life_max;
	double v_ang;
	double speed_max;
	double shield;
	double shield_max;
	bool alive;
	double vision;
	std::vector<unsigned long> lastFire;
	std::vector<unsigned long> lastRegeneration;
	
	Vector3 shipColor;
	Vector3 offset;
	Ship(std::string _id_mesh, std::string _id_controller, Vector3 _position, Matrix44 * _model,std::string _tipo_nave, std::string _shader, std::string _team);
	~Ship();
	void Move(std::string _action, double _value, double _secconds_elapsed);
	void setTag(std::string _tag, std::string _value);
	std::string getTag(std::string _tag);

	void processMessage(std::string _message);

private:
	std::map<std::string,std::string> tags;
};

#endif
